package com.daidai.sink;

import com.daidai.sink.domain.User;
import com.daidai.sink.mysqlsink.MyMySqlSink;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class MySqlSink {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        DataStreamSource<User> userSource = env.fromElements(new User(1, "admin", "admin"));

        userSource.addSink(new MyMySqlSink());

        env.execute();

    }

}
